package com.gopay.bis.dao.bankorder.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.gopay.bis.dao.bankorder.BcdlSendBankLogDAO;
import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.bank.BcdlSendBankLog;
/**
 * 银企发往银行日志记录DAO
 * 
 * @BcdlSendBankLogDAOImpl.java
 * @author lilili
 * @2017-8-11 下午03:29:06 www.gopay.com.cn Inc.All rights reserved.
 */
@Service("bcdlSendBankLogDAO")
public class BcdlSendBankLogDAOImpl extends BaseDAOImpl<BcdlSendBankLog, String> implements BcdlSendBankLogDAO {

	@Override
	public BcdlSendBankLog getBcdlSendLogById(String orderId) {
		String hql = "from BcdlSendBankLog where gopayOrderId = :orderId";

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("orderId", orderId);

        List<BcdlSendBankLog> list = this.findByHql(hql, params);
        if (list != null && list.size() > 0) {
            return list.get(0);
        }

        return null;
	}

	@Override
	public void deleteBcdlSendLog(BcdlSendBankLog bcdlSendBankLog) {
		this.delete(bcdlSendBankLog);
	}

}
